package cn.ljy.mes.model;

import cn.ljy.common.model.BaseModel;
import cn.ljy.common.model.validate.AddWorkValidation;
import cn.ljy.common.model.validate.UpdateWorkValidation;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@ApiModel(value="汽车工艺")
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false,of = {"id"})
public class MesCarTechnologyDetail extends BaseModel {
    @NotNull(groups = UpdateWorkValidation.class,message="id不能为空")
    private String id;
    @NotNull(groups = AddWorkValidation.class,message="工艺不能为空")
    private MesCarTechnology carTechnology;//所属工艺
    @NotNull(groups = AddWorkValidation.class,message="物料不能为空")
    private MesMaterial material;//物料不能为空
    @NotNull(groups = AddWorkValidation.class,message="数量不能为空")
    private Long quantity;//数量
    @NotNull(groups = AddWorkValidation.class,message="排序不能为空")
    private Integer sort;//排序
    @NotBlank(message = "编号不能为空")
    @Length(min = 1, max = 30, message = "名称长度必须在 {min} - {max} 之间")
    private String code;//汽车生产批次/型号/代码，也就是这个生产工艺对应的汽车批号等
    @NotNull(groups = AddWorkValidation.class,message="启用状态不能为空")
    private Boolean enabled;//是否启用,true表示启用

    //非数据库字段
//    private String materialId;//物料id，用于接收表单的值
}
